<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Cache-Control" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		<meta http-equiv="X-UA-Compatible" content="E=edge;chrome=1" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" type="text/css" href="<%=path%>/static/css/reset.css">
		<link rel="stylesheet" type="text/css" href="<%=path%>/static/css/weui.min.css">
		<link rel="stylesheet" type="text/css" href="<%=path%>/static/css/index.css">
		<title>嘉华金融</title>
    </head>
    <body>
	<div>
		<div class="header">
			<div><div class="back"></div></div>
			<div>经销商信息</div>
			<div><!-- <div class="user-img"></div> --></div>
		</div>
		<div class="main">
			<div class="dealer-wrap">
				<div class="weui-cells">
		            <div class="weui-cell dealer-height">
		                <div class="weui-cell__hd"></div>
		                <div class="weui-cell__bd">
		                    <p>经销商等级</p>
		                </div>
		                <div class="weui-cell__ft">${roleName}</div>
		            </div>
		            <div class="weui-cell">
		                <div class="weui-cell__hd"></div>
		                <div class="weui-cell__bd">
		                    <p>邀请注册人员</p>
		                </div>
		            </div>
				    <c:forEach items="${bUserInfos}" var="item" varStatus="vs">
                       <div class="weui-cell delar-list">
                           <div class="weui-cell__hd home-icon" style="background:url('${item.headImgUrl}');background-size:100% auto"></div>
                            <div class="weui-cell__bd home-p">
                                <p>${item.wxNickname}</p>
                            </div>
                        </div>
                     </c:forEach>                         
        		</div>
			</div>
		</div>
		<c:if test="${flag eq 0}">
		   <li class="registered-btn">
              <div class="btn h-btn" id="btn" style="margin-top: 20px;background:#fedf44"><a href="javascript:apply()">申请提升等级</a></div>
         </li>
		</c:if>
	</div>
</body>
<script type="text/javascript" src="<%=path%>/static/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="<%=path%>/static/layer/layer.js"></script>
<script type="text/javascript">
   var path="<%=path%>"
   var flag = true;
   function apply(){
	   if(flag){
	   flag=false;
	   $.ajax({
		    type:"post",
	        url:"<%=path %>/member/insertGrade.html",
	        dataType: "json",  
	        timeout: 10000,  
	        cache: false,  
	        error: function(){
	        	flag=true;
	            alert("系统忙...");
	        },
	        success: function(data){
	        	flag=true;
	           var json=eval(data);
	           layer.msg(json.msg)
	        }  
	   });
	 }
   }
   $('.back').on('click', function () {
       window.location=path+"/member/memberCenter.html";
   });
</script>
</html>
